package 力扣刷题.探索初级算法.字符串.反转字符串;

import java.util.Scanner;

public class Solution {
    public void reverseString(char[] s) {
        for (int i = 0; i < s.length/2; i++) {

            swap(s, i, s.length-1-i);
        }
    }
public void swap(char[] s,int firstPos,int secondPos) {
        char temp=s[firstPos];
        s[firstPos]=s[secondPos];
        s[secondPos]=temp;
}
    public static void main(String[] args) {
        int len;
        Scanner scanner=new Scanner(System.in);
        len=scanner.nextInt();
        char[] s=new char[len];
        for (int i = 0; i < len; i++) {
            s[i]=scanner.next().charAt(0);
        }
        new Solution().reverseString(s);
        for (int i = 0; i < len; i++) {
            System.out.println(s[i]);
        }
    }
}
